package com.appbee.core.client.nav;

import javax.inject.Singleton;

import com.appbee.core.client.place.INamePlace;
import com.appbee.core.client.util.PathIndex;

@Singleton
public class SimpleNavRegistry
{
	PathIndex<SimpleNav> pathIndex = new PathIndex<SimpleNav>();

	public SimpleNav getByPlace(INamePlace place)
	{
		String name = place.getName();
		return pathIndex.get(name);
	}

	public void add(SimpleNav nav)
	{
		pathIndex.add(nav.getPath(), nav);
	}
}
